package com.zb.api.common.econts;


public enum HallRoomEnum {
    MASTER_BEDROOM(1, "主卧"),
    STUDY(2, "书房"),
    SECONDARY_RECUMBENT(3, "次卧"),
    PRESENCE_CHAMBER(4, "客厅"),
    KITCHEN(5, "厨房"),
    TOILET(6, "卫生间"),
    BALCONY(7, "阳台"),
    CLOAKROOM(8, "衣帽间"),
    GARAGE(9, "车库"),
    OTHER(10, "其他")
  ;

    private String desc;
    private Integer value;

    HallRoomEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getValue() {
        return value;
    }


    public static HallRoomEnum valueOf(Integer value) {
        for (HallRoomEnum statusEnum : values()) {
            if (statusEnum.getValue().equals(value)) {
                return statusEnum;
            }
        }
        throw new RuntimeException("没有找到对应的枚举");
    }

    public static String value (Integer value) {
        for (HallRoomEnum item : HallRoomEnum.values()) {
            if (item.getValue().equals(value)) {
                return item.getDesc();
            }
        }
        return null;
    }
}
